#ifndef PROGRESSBAR_H
#define PROGRESSBAR_H

#include "process.h"

#include <QWidget>
#include <QTimer>
#include <QDebug>
#include <QDesktopWidget>


namespace Ui {
  class progressbar;
}

class progressbar : public QWidget
{
  Q_OBJECT
  
public:
  explicit progressbar(QWidget *parent = 0);
  ~progressbar();

public slots:

  bool startWork(unsigned int time, QString type, QString FPath);
signals:
  void clickedCloseButton();
  void changedProgressBarValue();
  void changedProgressBarMaxValue();
  void changedProgressBarOpacity();
  void changedProgressBarColor();
  void changedProgressBarStatus();
  void changedProgressBarTimerValue();
  void clickedNextButton();
  void clickedIncrementButton();
  void timerIsOver();

  
private slots:
  //void setProgressBarValue(unsigned int value=1);
  void minusProgressBarValue();
 // void setProgressBarMaxValue(unsigned int value=2);
  void setProgressBarOpacity(qreal value);
  void setProgressBarColor(QString color);
  void setProgressBarStatus();
  void setClearProgressBar();
  void procTerminated(int);

  void on_buttonClose_clicked();

  void on_buttonNext_clicked();

  void on_buttonIncrement_clicked();

private:
  Ui::progressbar *ui;
  Process* Proc;
  QTimer* refreshTimer;
  unsigned int refreshSpeed;
  int middleStatus, lowStatus;
  int heightPbar;

};

#endif // PROGRESSBAR_H
